#include <bits/stdc++.h>

using namespace std;

class Solution
{
public:
    vector<int> findErrorNums(vector<int> &nums)
    {
        vector<int> ans(2);
        unordered_map<int, int> m;
        for (auto &num : nums)
        {
            m[num]++;
        }
        int n = nums.size();
        for(int i = 1; i <= n; i++)
        {
            int count = m[i];
            if(count == 2)
            {
                ans[0] = i;
            }
            else if (count == 0)
            {
                ans[1] = i;
            }
        }
        return ans;
    }
};

int main(int argc, char const *argv[])
{

    return 0;
}
